import App from './App'
import uView from '@/uni_modules/uview-ui'
import { $http } from '@escook/request-miniprogram'
// #ifndef VUE3
import Vue from 'vue'
uni.$http = $http
$http.baseUrl = "https://api.gamestrial.com/intelligent_health"
// 请求拦截器
$http.beforeRequest = function(config) {
	// 提示加载中
	uni.showLoading({
		title: "数据加载中..."
	})
	// 请求头添加 token
	const token = uni.getStorageSync('token');
	if (token) {
		options.header = {
			token
		}
	}
}
// 响应拦截器
$http.afterRequest = function() {
	// 关闭提示
	uni.hideLoading()
}
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(uView)
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif